#! /bin/bash
export LANG=zh_CN.UTF-8
PRESTO_HOME=/export/server/presto/bin/presto


${PRESTO_HOME} --catalog hive --server 192.168.88.80:8090 --execute "
--1
DROP TABLE IF EXISTS edu_online.ads_area_tlm_num;
CREATE TABLE mysql.edu_online.ads_area_tlm_num
AS
SELECT * FROM hive.edu_online_ads.ads_area_tlm_num;



DROP TABLE IF EXISTS edu_online.ads_channel_tlm_num;
CREATE TABLE mysql.edu_online.ads_channel_tlm_num
AS
SELECT * FROM hive.edu_online_ads.ads_channel_tlm_num;


DROP TABLE IF EXISTS edu_online.ads_day_line_member_count;
CREATE TABLE mysql.edu_online.ads_day_line_member_count
AS
SELECT * FROM hive.edu_online_ads.ads_day_line_member_count;

DROP TABLE IF EXISTS edu_online.ads_hour_line_member_rate;
CREATE TABLE mysql.edu_online.ads_hour_line_member_rate
AS
SELECT * FROM hive.edu_online_ads.ads_hour_line_member_rate;

--2
DROP TABLE IF EXISTS edu_online.ads_reference_tlm_num;
CREATE TABLE mysql.edu_online.ads_reference_tlm_num
AS
SELECT * FROM hive.edu_online_ads.ads_reference_tlm_num;

-- 3
DROP TABLE IF EXISTS edu_online.ads_school_tlm_num;
CREATE TABLE mysql.edu_online.ads_school_tlm_num
AS
SELECT * FROM hive.edu_online_ads.ads_school_tlm_num;


DROP TABLE IF EXISTS edu_online.ads_subject_tlm_num;
CREATE TABLE mysql.edu_online.ads_subject_tlm_num
AS
SELECT * FROM hive.edu_online_ads.ads_subject_tlm_num;

DROP TABLE IF EXISTS edu_online.ads_time_line_member_num;
CREATE TABLE mysql.edu_online.ads_time_line_member_num
AS
SELECT * FROM hive.edu_online_ads.ads_time_line_member_num;
"